home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 02 - 1986 / 02.06 Jun 86.sit / 02.06 Jun 86 / Basic sources / statement adder.bas (.txt) < prev   
Encoding:
AmigaBASIC Source Code  |  1986-04-19  |  2.8 KB  |  88 lines  |  [MSBC/MSBB]

  1. 'Statement Adder for RealFont, KbEquiv, and setItemStyle libraries
  2. 'By Clear Lake Research and David Kelly
  3. '© Clear Lake Research, Inc.
  4. 'used with permission
  5. 'NOTE: The hex codes for RealFont, KbEquiv, and setItemStyle
  6. 'are copyrighted by Clear Lake Research. 
  7. 'By using Statement Adder you may create these libraries
  8. 'then add them to your ToolLib Libraries using 
  9. 'Statement Mover (provided with CLR ToolLib).
  10. 'This program requires ToolLib and MS Basic 2.0 or 2.1
  11. 'Run this program only once.
  12.  
  13. LIBRARY"ToolLib"
  14. DIM p%(120)
  15. DEFINT i,j
  16. FOR j=1 TO 3
  17.     ERASE p%
  18.     REM  read hex code
  19.     READ nm$
  20.     READ id%
  21.     READ numofbytes%
  22.     DIM p%(numofbytes%)
  23.     FOR i%= 1 TO numofbytes%
  24.         READ p%(i%)
  25.     NEXT i%
  26.     
  27.  
  28. fileRefNum%=0:H!=0
  29. openResFile"NewLibraries",fileRefNum%                    'openResFile
  30. saveArray fileRefNum%,p%(1),numofbytes%*2,id%,nm$    'save as type 'GNRL'
  31. GetNamedRes fileRefNum%,"GNRL",nm$,H!  'get the resource
  32. detachRes H!                                                 'Now it is not a resource
  33. AddRes fileRefNum%,H!,"CODE",id%,nm$       'Now its type CODE
  34. releaseRes H!                                               
  35. GetNamedRes fileRefNum%,"GNRL",nm$,H!    'Not needed
  36. removeRes fileRefNum%,H!                           'so remove it
  37. REM early printings of the manual had the syntax of removeRes wrong
  38. REM The first argument was left off
  39. CloseResFile fileRefNum%
  40. REM make sure libinit is in the file before running it!
  41. NEXT j
  42. PRINT"Done"
  43.  
  44. 'setItemStyle Library
  45. DATA "setItemStyle" :REM name of resource nm$
  46. DATA 5001: REM id number id%
  47. DATA 33: REM number of bytes
  48. DATA &H8,&H0,&H4EAD,&H2A,&HC00
  49. DATA &H3,&H662C,&H3A12,&H5245,&H4EAD
  50. DATA &H2A,&HC00,&H3,&H661E,&H3612
  51. DATA &H4EAD,&H2A,&HC00,&H3,&H6612
  52. DATA &H3812,&H42A7,&H3F05,&HA949,&H3F03
  53. DATA &H3F04,&HA942,&H7000,&H4E75,&H740D
  54. DATA &H7000,&H4EAD,&H42
  55.  
  56.  
  57.  
  58. 'RealFont Library
  59. DATA "RealFont": REM name of resource nm$
  60. DATA 703: REM id number id%
  61. DATA 37: REM number of bytes
  62. DATA &H8,&H0,&H4EAD,&H2A,&HC00
  63. DATA &H3,&H6632,&H3812,&H4EAD,&H2A
  64. DATA &HC00,&H3,&H6626,&H3A12,&H4EAD
  65. DATA &H2A,&HC40,&H3,&H661A,&H4267
  66. DATA &H3F04,&H3F05,&HA902,&H301F,&H6708
  67. DATA &H34BC,&HFFFF,&H7000,&H4E75,&H4252
  68. DATA &H7000,&H4E75,&H7000,&H303C,&HD
  69. DATA &H4EAD,&H42
  70.  
  71. 'KbEquiv Library
  72. DATA "KbEquiv":REM name of resource nm$
  73. DATA 191:REM id number id%
  74. DATA 58: REM number of bytes
  75. DATA &H0,&H1,&H4EAD,&H2A,&HC00
  76. DATA &H3,&H665E,&H3812,&H5244,&H4EAD
  77. DATA &H2A,&HC00,&H3,&H6650,&H3A12
  78. DATA &H4EAD,&H2A,&HC00,&H2,&H6644
  79. DATA &H264A,&H4EAD,&H82,&H4EAD,&H8A
  80. DATA &H1613,&H42A7,&H3F04,&HA949,&H2657
  81. DATA &H2653,&H303C,&HE,&H1233,&H0
  82. DATA &H5241,&HD041,&H5345,&H6008,&H1233
  83. DATA &H0,&H5A41,&HD041,&H51CD,&HFFF6
  84. DATA &H1233,&H0,&H5441,&HD041,&H1783
  85. DATA &H0,&HA948,&H7000,&H4E75,&H740D
  86. DATA &H7000,&H4EAD,&H42
  87.  
  88.